#! /bin/bash

rm -rf target && mkdir -p target/classes

CP=`lein classpath`

echo "compile java code"
find src/java -name "*.java" | xargs javac -Xlint:unchecked -g -target 1.6 -source 1.6 -encoding utf8 -cp $CP -d target/classes -sourcepath src/java/

echo "compile java test code"
find test/java -name "*.java" | xargs javac -g -Xlint:unchecked -target 1.6 -source 1.6 -encoding utf8 -cp $CP -d target/classes -sourcepath test/java

# add resources
java -cp $CP org.junit.runner.JUnitCore org.httpkit.HttpKitTestSuite
